﻿var userAgent = navigator.userAgent, 
				rMsie = /(msie\s|trident.*rv:)([\w.]+)/, 
				rFirefox = /(firefox)\/([\w.]+)/, 
				rOpera = /(opera).+version\/([\w.]+)/, 
				rChrome = /(chrome)\/([\w.]+)/, 
				rSafari = /version\/([\w.]+).*(safari)/;
				var browser;
				var version;
				var ua = userAgent.toLowerCase();
				function uaMatch(ua) {
					var match = rMsie.exec(ua);
					if (match != null) {
						return { browser : "IE", version : match[2] || "0" };
					}
					var match = rFirefox.exec(ua);
					if (match != null) {
						return { browser : match[1] || "", version : match[2] || "0" };
					}
					var match = rOpera.exec(ua);
					if (match != null) {
						return { browser : match[1] || "", version : match[2] || "0" };
					}
					var match = rChrome.exec(ua);
					if (match != null) {
						return { browser : match[1] || "", version : match[2] || "0" };
					}
					var match = rSafari.exec(ua);
					if (match != null) {
						return { browser : match[2] || "", version : match[1] || "0" };
					}
					if (match != null) {
						return { browser : "", version : "0" };
					}
				}
				var browserMatch = uaMatch(userAgent.toLowerCase());
				if (browserMatch.browser) {
					browser = browserMatch.browser;
					version = browserMatch.version;
				}

var str = '';

var copyright='湖北省水文水资源中心[专用];V5.0S0xGAAEAAAAAAAAAEAAAAEUBAABQAQAALAAAAJ52NvbdyvTJ49aHA/uVVvVnp/ZDqqp7mjj2issylZSU1EvzKSLG2VrPuuIjALdWhq32Ynr9ibmYoufVrrq6wkPd3a/JAs+XFOIBM/WBaw2eIH7jT8J6/gmikNW+JXho0bjVhA1dPkITZuCD836p+J5PWOAaYPJRhVAJBjZHMIBtyEPA47S4EIxulxV+8M5bVoLLjxvytizOFpsERaPzbKcyoGX5dGZYd4wzQIEuxM9lFciPEAFsnzscdM+iAY/N/0Ijo6Umq1wEpFYfLBIxKsyKDtvuRu7rJRzHd8qscksNhOMnnsX434wBQ2qDdASPpxPAMiCcM7swYfnc0IpGdTtpLJnZ2iU+0G2EVPdGw5ys0dYitxt/un9f9xbv0seQZ+M9aFNSBzPfbQQsBFcJt9YJvDXNRUYX+2Mud9X0XIV/usPyRxdouw6ZSgAiR/BcVcjSIVd1TJS30lAIbKTaiGU=';



if ((window.ActiveXObject!=undefined) || (window.ActiveXObject!=null) ||"ActiveXObject" in window)
{
	str += '<object id="iWebPDF2018" ';
	str += ' width="100%"';
	str += ' height="100%"';
	/*
	if(window.navigator.platform == "Win32")
		str += ' CLASSID="CLSID:D89F482C-5045-4DB5-8C53-D2C9EE71D025"  codebase="iWebOffice2015.cab#version=12,5,0,648"';
	if (window.navigator.platform == "Win64")
		str += ' CLASSID="CLSID:D89F482C-5045-4DB5-8C53-D2C9EE71D024"  codebase="iWebOffice2015.cab#version=12,5,0,648"';
	str += '>';
	*/
	if(window.navigator.platform == "Win32")
		str += ' CLASSID="CLSID:7017318C-BC50-4DAF-9E4A-10AC8364C315"';
	if (window.navigator.platform == "Win64")
		str += ' CLASSID="CLSID:7017318C-BC50-4DAF-9E4A-10AC8364C364"';
	str += ' codebase="iWebPDF2018.cab"';
	str += '>';
	
}
else if (browser == "chrome") 
{
	str += '<object id="iWebPDF2018" ';
	str += ' width="100%"';
	str += ' height="100%"';
	str += ' clsid="CLSID:7017318C-BC50-4DAF-9E4A-10AC8364C315"';         
	str += ' type="application/kg-plugin"';
	str += ' OnAddinEventInvoke="OnAddinEventInvoke"';
	str += ' OnCommand="OnCommand"';
	str += ' OnOpen="OnOpen"';
	str += ' OnAddSignature="OnAddSignature"';
	str += ' OnWebSaveAfter="OnWebSaveAfter"';
	str += ' OnOLECommand="OnOLECommand"';	
	str += ' OnToolsClick="OnToolsClick"';			//绑定自定义按钮触发事件
	str += ' Copyright="' + copyright + '"';
	str += '>';
}
else if (browser == "firefox") 
{
	str += '<object id="iWebPDF2015" ';
	str += ' width="100%"';
	str += ' height="100%"';
	str += ' clsid="CLSID:7017318C-BC50-4DAF-9E4A-10AC8364C315"';
	str += ' type="application/kg-activex"';
	str += ' OnCommand="OnCommand"';
	str += ' OnAddinEventInvoke="OnAddinEventInvoke"';
	str += ' OnOLECommand="OnOLECommand"';
	str += ' Copyright="' + copyright + '"';
	str += '>';
}
str += '</object>';
document.write(str); 
//alert(str);


